package com.example.memohehang.service.Impl;



import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.example.memohehang.common.R;
import com.example.memohehang.domain.Type;
import com.example.memohehang.mapper.TypeMapper;
import com.example.memohehang.service.TypeService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements TypeService
{
    /**
     * 获取所有类型
     * @return
     */
    @Override
    public R typeMapping()
    {
        List<Type> types = list();
        HashMap<Integer, String> hashMap = new HashMap<>();
        for (Type type : types)
        {
            hashMap.put(type.getTypeid(), type.getType());
        }
        return R.success(hashMap);
    }
}

